<div class="control-group">
<!--    <label for="editor" class="control-label">[label]：</label>-->
    <div class="controls">
        <script id="editor" type="text/plain" name="editor" style="width:600px;height:200px;">{present name="editor"}{$editor}{/present}</script>
    </div>
</div>
<script type="text/javascript" src="STATIC_PATH/plugins/editor/ueditor.config.js"></script>
<script type="text/javascript" src="STATIC_PATH/plugins/editor/ueditor.all.min.js"></script>
<script type="text/javascript" src="STATIC_PATH/plugins/editor/lang/zh-cn/zh-cn.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，
        // 直接调用UE.getEditor('editor')就能拿到相关的实例
        UE.Editor.prototype._bkGetActionUrl = UE.Editor.prototype.getActionUrl;
        UE.Editor.prototype.getActionUrl = function(action) {
            if (action == 'uploadimage' || action == 'uploadscrawl' || action == 'uploadimage') {
                return '/admin/uploader/upload';
            } else {
                return this._bkGetActionUrl.call(this, action);
            }
        };
        var ue = UE.getEditor('editor', {
            toolbars: [
                [
                    'source', //源代码
                    'bold', //加粗
                    'indent', //首行缩进
                    'pasteplain', //纯文本粘贴模式
                    'horizontal', //分隔线
                    'removeformat', //清除格式
                    'insertcode', //代码语言
                    'fontfamily', //字体
                    'fontsize', //字号
                    'paragraph', //段落格式
                    'map', //Baidu地图
                    'justifyleft', //居左对齐
                    'justifyright', //居右对齐
                    'justifycenter', //居中对齐
                    'justifyjustify', //两端对齐
                    'forecolor', //字体颜色
                    'lineheight', //行间距
                    'simpleupload' //单图上传
                ]
            ],
            autoHeightEnabled: true,
            autoFloatEnabled: true
        });
    });
    function get_editor_content() {
        var arr = [];
        arr.push(UE.getEditor('editor').getContent());
        return arr.join("\n");
    }
</script>